package fudan.se.lab2;

import fudan.se.lab2.domain.Contribution;
import fudan.se.lab2.domain.Invitation;
import fudan.se.lab2.domain.Meeting;
import fudan.se.lab2.domain.User;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class JudgeUtility {
    public static void contributionJudge(Contribution expected, Contribution judged) {
        assertEquals(expected.getContributor(), judged.getContributor());
        assertEquals(expected.getMeetingFullName(), judged.getMeetingFullName());
        assertEquals(expected.getFileTitle(), judged.getFileTitle());
        assertEquals(expected.getFileAbstract(), judged.getFileAbstract());
    }

    public static void invitationJudge(Invitation expected, Invitation judged) {
        assertEquals(expected.getFromUsername(), judged.getFromUsername());
        assertEquals(expected.getToUsername(), judged.getToUsername());
        assertEquals(expected.getMeetingFullName(), judged.getMeetingFullName());
        assertEquals(expected.getStatus(), judged.getStatus());
    }

    public static void meetingJudge(Meeting expected, Meeting judged) {
        assertEquals(expected.getAbbrName(), judged.getAbbrName());
        assertEquals(expected.getFullName(), judged.getFullName());
        assertEquals(expected.getChair(), judged.getChair());
        assertEquals(expected.getPcMembers(), judged.getPcMembers());
        assertEquals(expected.getDate(), judged.getDate());
        assertEquals(expected.getSpot(), judged.getSpot());
        assertEquals(expected.getSubmitDueDate(), judged.getSubmitDueDate());
        assertEquals(expected.getResultReleaseDate(), judged.getResultReleaseDate());
        assertEquals(expected.getStatus(), judged.getStatus());
    }

    public static void userJudge(User expected, User judged) {
        assertEquals(expected.getUsername(), judged.getUsername());
        assertEquals(expected.getPassword(), judged.getPassword());
        assertEquals(expected.getFullname(), judged.getFullname());
        assertEquals(expected.getEmail(), judged.getEmail());
        assertEquals(expected.getAffiliation(), judged.getAffiliation());
        assertEquals(expected.getRegion(), judged.getRegion());
        assertEquals(expected.getAuthorities(), judged.getAuthorities());
    }
}
